import useClipboard from 'vue-clipboard3'
import { ElMessage } from 'element-plus'

const { toClipboard } = useClipboard()

export default async(code:string)=>{
  try {
    await toClipboard(code);
    ElMessage({
      message: '复制成功',
      type: 'success',
    })
  } catch (e) {
    // console.error(e)
    ElMessage.error('复制失败:'+ e)
  }
}